var token = localStorage.getItem("key")
localStorage.setItem("proType","");
localStorage.setItem("proStage","");
localStorage.setItem("airspace","");
localStorage.setItem("ishigh","");
localStorage.setItem("isLight","");

var pageNum = 1;
var pageSize = 20;
var isOver = false;
var flags = 1;
var proType = "";
var proStage = "";
var airspace = "";
var ishigh = "";
var isLight = "";



function homeInit(){
    console.log(localStorage.getItem("LoginData"))
    var flag = getUrlParam("bool")
    if(flag == "true"){
        $(".myInfo").show("fast")
    }
    var loginData = JSON.parse(localStorage.getItem("LoginData"))
    $("#showBirth").html(loginData.birthday)
    var mylike = ""
    for(var i=0;i<loginData.like.length;i++){
        mylike += "<p class='my_ah float_l'>"+loginData.like[i]+"</p>"
    }
    $("#showLike").append(mylike)
    if(loginData!=null){
        $("#toux").attr("src",loginData.headImg)
        $(".my_name").html(loginData.userName)
        $(".my_ph").html(loginData.mobile)
        $("#companyName").html(loginData.companyName)
    }
    
    mui.init({
             pullRefresh: {
             container: '#pullrefresh',
             up : {
             height:100,
             auto:true,
             contentrefresh : "正在加载...",
             contentnomore:'没有更多数据了',
             callback: SelectPosition
             }
             }
             });
    
    getUnreadInfo();
}

function showUser(){
    $(".myInfo").css("left","-100%")
    $(".myInfo").fadeIn("fast").animate({"left":0},200);
}
function showPro(){
    $(".myInfo").animate({"left":"-100%"},200);
}
function getUrlParam(name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
    var r = window.location.search.slice(1).match(reg);
    if (r != null) return unescape(r[2]); return null;
}


function updImg(file){
    var formdata = new FormData();
    formdata.append("file",file);
    formdata.append("request",JSON.stringify({"token": token}));
    $.ajax({
           type: "POST",
           url: url_prefix + "user/update_headimg",
           data: formdata,
           processData:false,//对data参数进行序列化处理
           contentType:false,//内容编码类型
           success: function(data) {
           if(data.code == '200') {
           var loginData = JSON.parse(localStorage.getItem("LoginData"))
           loginData.headImg = data.headImg
           localStorage.setItem('LoginData', JSON.stringify(loginData));
           } else if (data.code == '300'){
           mui.toast("帐号在其他设备上登录")
           window.location.href="fastLogin.html"
           } else {
           mui.toast(data.message);
           }
           },
           error: function(XMLHttpRequest, textStatus, errorThrown) {
           
           mui.toast("连接服务器失败,请稍后重试``````");
           }
           });
}

function updName(){
    mui.prompt("请输入您的昵称","未输入不做修改","修改昵称",["取消","修改"],function(e){
               if(e.index == 1){
               if(e.value!="" && e.value != null){
               showDialog()
               $.ajax({
                      type: "POST",
                      url: url_prefix + "user/edit/updateUserMsg",
                      data: {
                      request: JSON.stringify({
                                              username: e.value,
                                              token: token
                                              })
                      },
                      dataType: "json",
                      success: function(data) {
                      if(data.code == '200') {
                      var loginData = JSON.parse(localStorage.getItem("LoginData"))
                      loginData.userName = e.value
                      localStorage.setItem('LoginData', JSON.stringify(loginData));
                      window.location.href="home.html?bool=true"
                      } else if (data.code == '300'){
                      mui.toast("帐号在其他设备上登录")
                      window.location.href="fastLogin.html"
                      } else {
                      mui.toast(data.message);
                      window.location.href="home.html?bool=true"
                      }
                      dismissDialog()
                      },
                      error: function(XMLHttpRequest, textStatus, errorThrown) {
                      //"{"readyState":0,"responseText":"","status":0,"statusText":"error"}"
                      //"XMLHttpRequest cannot load http://13.13.12.75:8080/renren-fast/app/user/edit/updateUserMsg. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://127.0.0.1:8020' is therefore not allowed access."    /辰东/home.html (0)
                      mui.toast("连接服务器失败,请稍后重试``````");
                      dismissDialog()
                      }
                      });
               }
               }
               },"div")
}




function getUnreadInfo(){
    $.ajax({
           type: "POST",
           url: url_prefix + "home/informationNum",
           data: {
           request: JSON.stringify({
                                   "token":token
                                   })
           },
           dataType: "json",
           success: function(data){
           if(data.code == '200'){
           var num = data.result.msgNum;
           if(num>0){
           $("#msgImg").attr("src","img/icon_notify.png");
           }else{
           $("#msgImg").attr("src","img/nav_icon_notice@2x.png");
           }
           } else if (data.code == '300'){
           mui.toast("帐号在其他设备上登录")
           window.location.href="fastLogin.html"
           } else {
           mui.toast("连接服务器失败,请稍后重试``````");
           }
           }
           });
}
var sflag = true
function SelectPosition() {
    if($("#prov").val() == "true"){
        sflag = true
    }
    if($("#pronamev").val() == "true"){
        sflag = true
    }
    if($("#procondiv").val() == "true"){
        sflag = true
    }
    if(sflag){
        sflag = false
        $("#prov").val("false")
        $("#pronamev").val("false")
        $("#procondiv").val("false")
        if(flags==1){
            getPro();
            
        }else if(flags==2){
            queryProjectList(vocabularyName);
        }else if(flags==3){
            SubCondition();
        }
        mui('#pullrefresh').pullRefresh().endPullupToRefresh(isOver);
    }
};
function getPro(){
    flags = 1;
    $.ajax({
           type: "POST",
           url: url_prefix + "home/getProjectList",
           data: {
           request: JSON.stringify({
                                   "token":token,
                                   "pageNum":pageNum,
                                   "pageSize":pageSize
                                   })
           },
           dataType: "json",
           success: function(data){
           if(data.code == '200'){
           var proList = data.result.list
           if(proList.length<1){
           mui.toast('暂无数据...')
           
           }
           var str = null;
           for(var i = 0;i<proList.length;i++){
           str = '<div class="projectList" name="'+proList[i].projectId+'" proName="'+proList[i].projectName+'"><div class="project_img float_l" ><img style = "height: 95px;" src='+proList[i].projectImg+'>';
           str =str+'</div><div class="project_right float_l" ><p class="project_name" value='+proList[i].projectName+'></p>';
           str = str +'<p class="project_ad" hidden="hidden" id="proId'+i+'">'+proList[i].projectId+'</p>';
           str = str +'<p style="font-size:15px;">'+proList[i].projectName+'</p>'
           str = str +'<p class="project_ad" >地址：'+proList[i].address+'</p>';
           str = str +'<div class="project_nub">';
           str = str +'<div class="project_nub_sb"><img class="float_l project_nub_img" src="img/icon_controller_nub@2x.png">'+proList[i].projectAllNum+'</div>';
           str = str +'<div class="float_l state_nub"><span class="controller_nom float_l"></span>'+proList[i].projectGoodNum+'</div>';
           str = str +'<div class="float_l state_nub"><span class="controller_bad float_l"></span>'+proList[i].projectBadNum+'</div>';
           str = str +'<div class="clear"></div></div><div class="project_speed" >';
           str = str +'<div class="float_l project_speed_nub"><img class="float_l project_speed_img" src="img/icon_speed@2x.png">'+proList[i].windValue+' m/s</div>';
           str = str +'<a id="'+proList[i].projectId+'" class="list_but float_r" >设置警报</a><div class="clear"></div></div></div><div class="clear"></div></div>'
           $("#div1").append(str);
           
           }
           var tPage = 0;
           var ys = data.result.total%pageSize
           if(ys>0){
           tPage = data.result.total/pageSize + 1
           }else{
           tPage = data.result.total/pageSize
           }
           if(pageNum<tPage){
           if(proList.length < pageSize){
           isOver = true;
           mui('#pullrefresh').pullRefresh().endPullupToRefresh(isOver);
           }
           if(isOver == false){
           pageNum++;
           }
           }else{
           isOver = true;
           mui('#pullrefresh').pullRefresh().endPullupToRefresh(isOver);
           }
           }else if (data.code == '300'){
           mui.toast("帐号在其他设备上登录")
           window.location.href="fastLogin.html"
           }else{
           mui.toast("连接服务器失败,请稍后重试``````");
           }
           $("#prov").val("true")
           },
           error: function(XMLHttpRequest, textStatus, errorThrown) {
           
           mui.toast("连接服务器失败,请稍后重试``````");
           }
           });
};



function queryProjectList(val){
    var names  = val;
    flags =2;
    $.ajax({
           type: "POST",
           url: url_prefix + "home/queryProjectList",
           data: {
           request: JSON.stringify({
                                   "token":token,
                                   "pageNum":pageNum,
                                   "pageSize":pageSize,
                                   "name":names
                                   })
           },
           dataType: "json",
           success: function(data){
           if(data.code == '200'){
           var proList = data.result.list
           if(proList.length<1){
           mui.toast('暂无数据...')
           isOver = true;
           mui('#pullrefresh').pullRefresh().endPullupToRefresh(isOver);
           }else{
           if(pageNum == 1){
           $("#div1").empty()
           }
           var str = null;
           for(var i = 0;i<proList.length;i++){
           str = '<div class="projectList" name="'+proList[i].projectId+'" proName="'+proList[i].projectName+'"><div class="project_img float_l" ><img style = "height: 95px;" src='+proList[i].projectImg+'>';
           str =str+'</div><div class="project_right float_l" ><p class="project_name" value='+proList[i].projectName+'></p>';
           str = str +'<p class="project_ad" hidden="hidden" id="proId'+i+'">'+proList[i].projectId+'</p>';
           str = str +'<p style="font-size:15px;">'+proList[i].projectName+'</p>'
           str = str +'<p class="project_ad" >地址：'+proList[i].address+'</p>';
           str = str +'<div class="project_nub">';
           str = str +'<div class="project_nub_sb"><img class="float_l project_nub_img" src="img/icon_controller_nub@2x.png">'+proList[i].projectAllNum+'</div>';
           str = str +'<div class="float_l state_nub"><span class="controller_nom float_l"></span>'+proList[i].projectGoodNum+'</div>';
           str = str +'<div class="float_l state_nub"><span class="controller_bad float_l"></span>'+proList[i].projectBadNum+'</div>';
           str = str +'<div class="clear"></div></div><div class="project_speed" >';
           str = str +'<div class="float_l project_speed_nub"><img class="float_l project_speed_img" src="img/icon_speed@2x.png">'+proList[i].windValue+' m/s</div>';
           str = str +'<a id="'+proList[i].projectId+'" class="list_but float_r" >设置警报</a><div class="clear"></div></div></div><div class="clear"></div></div>'
           $("#div1").append(str);
           
           }
           var tPage = 0;
           var ys = data.result.total%pageSize
           if(ys>0){
           tPage = data.result.total/pageSize + 1
           }else{
           tPage = data.result.total/pageSize
           }
           if(pageNum<tPage){
           if(proList.length < pageSize){
           isOver = true;
           mui('#pullrefresh').pullRefresh().endPullupToRefresh(isOver);
           }
           if(isOver == false){
           pageNum++;
           }
           }else{
           isOver = true;
           mui('#pullrefresh').pullRefresh().endPullupToRefresh(isOver);
           }
           }
           }else if (data.code == '300'){
           mui.toast("帐号在其他设备上登录")
           window.location.href="fastLogin.html"
           }else{
           mui.toast("连接服务器失败,请稍后重试``````");
           }
           $("#pronamev").val("true")
           },
           error: function(XMLHttpRequest, textStatus, errorThrown) {
           
           mui.toast("连接服务器失败,请稍后重试``````");
           }
           });
};

function conditons(){
    proType = "";
    proStage = "";
    airspace = "";
    ishigh = "";
    isLight = "";
    pageNum =1;
    $("#div2").html("");
    $("#divlist").hide();
    // $("#div1").empty();
    $.ajax({
           type: "POST",
           url: url_prefix + "home/getProjectCondition",
           data: {
           request: JSON.stringify({
                                   "token":token
                                   })
           },
           dataType: "json",
           success: function(data){
           if(data.code == '200'){
           var proList = data.result;
           var str = null;
           for(var i = 0;i<proList.length;i++){
           str = '<div class="condition_one"><p class="condition_title">'+proList[i].conditionName+'</p><div class="condition_list" id="cd'+i+'">';
           var valueList = proList[i].conditionValue;
           for(var j=0;j<valueList.length;j++){
           if(i==0){
           if(localStorage.getItem("proType")==valueList[j]){
           proType=localStorage.getItem("proType");
           str = str +'<p class="float_l" onclick="changeStyle'+i+'(this)" style="background: #B12F41;color:#ffffff;">'+valueList[j]+'</p>';
           }else{
           str = str +'<p class="float_l" onclick="changeStyle'+i+'(this)">'+valueList[j]+'</p>';
           }
           }else if(i==1){
           if(localStorage.getItem("proStage")==valueList[j]){
           proStage=localStorage.getItem("proStage");
           str = str +'<p class="float_l" onclick="changeStyle'+i+'(this)" style="background: #B12F41;color:#ffffff;">'+valueList[j]+'</p>';
           }else{
           str = str +'<p class="float_l" onclick="changeStyle'+i+'(this)">'+valueList[j]+'</p>';
           }
           }else if(i==2){
           if(localStorage.getItem("airspace")==valueList[j]){
           airspace=localStorage.getItem("airspace");
           str = str +'<p class="float_l" onclick="changeStyle'+i+'(this)" style="background: #B12F41;color:#ffffff;">'+valueList[j]+'</p>';
           }else{
           str = str +'<p class="float_l" onclick="changeStyle'+i+'(this)">'+valueList[j]+'</p>';
           }
           }else if(i==3){
           if(localStorage.getItem("ishigh")==valueList[j]){
           ishigh=localStorage.getItem("ishigh");
           str = str +'<p class="float_l" onclick="changeStyle'+i+'(this)" style="background: #B12F41;color:#ffffff;">'+valueList[j]+'</p>';
           }else{
           str = str +'<p class="float_l" onclick="changeStyle'+i+'(this)">'+valueList[j]+'</p>';
           }
           }
           else if(i==4){
           if(localStorage.getItem("isLight")==valueList[j]){
           isLight=localStorage.getItem("isLight");
           str = str +'<p class="float_l" onclick="changeStyle'+i+'(this)" style="background: #B12F41;color:#ffffff;">'+valueList[j]+'</p>';
           }else{
           str = str +'<p class="float_l" onclick="changeStyle'+i+'(this)">'+valueList[j]+'</p>';
           }
           }
           }
           str = str + '<div class="clear"></div></div></div>'
           $("#div2").append(str);
           }
           }else if (data.code == '300'){
           mui.toast("帐号在其他设备上登录")
           window.location.href="fastLogin.html"
           }else{
           mui.toast("连接服务器失败,请稍后重试``````");
           }
           },
           error: function(XMLHttpRequest, textStatus, errorThrown) {
           
           mui.toast("连接服务器失败,请稍后重试``````");
           }
           });
    $("#divselc").show();
};

function changeStyle0(ele) {
    var a = ele.style.background;
    if(a == 'rgb(177, 47, 65)') {
        $("#cd0  p").css({
                         "background": "",
                         "color": ""
                         });
        proType = "";
        localStorage.setItem("proType","")
    } else {
        $("#cd0  p").css({
                         "background": "",
                         "color": ""
                         });
        ele.style.background = "#B12F41";
        ele.style.color = "#ffffff";
        proType = $(ele).html();
        localStorage.setItem("proType",proType)
    }
};

function changeStyle1(ele) {
    var a = ele.style.background;
    if(a == 'rgb(177, 47, 65)') {
        $("#cd1  p").css({
                         "background": "",
                         "color": ""
                         });
        proStage = "";
        localStorage.setItem("proStage","")
    } else {
        $("#cd1  p").css({
                         "background": "",
                         "color": ""
                         });
        ele.style.background = "#B12F41";
        ele.style.color = "#ffffff";
        proStage = $(ele).html();
        localStorage.setItem("proStage",proStage)
    }
};

function changeStyle2(ele) {
    var a = ele.style.background;
    if(a == 'rgb(177, 47, 65)') {
        $("#cd2  p").css({
                         "background": "",
                         "color": ""
                         });
        airspace = "";
        localStorage.setItem("airspace","")
    } else {
        $("#cd2  p").css({
                         "background": "",
                         "color": ""
                         });
        ele.style.background = "#B12F41";
        ele.style.color = "#ffffff";
        airspace = $(ele).html();
        localStorage.setItem("airspace",airspace)
    }
};

function changeStyle3(ele) {
    var a = ele.style.background;
    if(a == 'rgb(177, 47, 65)') {
        $("#cd3  p").css({
                         "background": "",
                         "color": ""
                         });
        ishigh = "";
        localStorage.setItem("ishigh","")
    } else {
        $("#cd3  p").css({
                         "background": "",
                         "color": ""
                         });
        ele.style.background = "#B12F41";
        ele.style.color = "#ffffff";
        ishigh = $(ele).html();
        localStorage.setItem("ishigh",ishigh)
    }
};

function changeStyle4(ele) {
    var a = ele.style.background;
    if(a == 'rgb(177, 47, 65)') {
        $("#cd4  p").css({
                         "background": "",
                         "color": ""
                         });
        isLight = "";
        localStorage.setItem("isLight","")
    } else {
        $("#cd4  p").css({
                         "background": "",
                         "color": ""
                         });
        ele.style.background = "#B12F41";
        ele.style.color = "#ffffff";
        isLight = $(ele).html();
        localStorage.setItem("isLight",isLight)
    }
};
function cpro(){
    pageNum =1;
    isOver = false
    flags = 3;
    SelectPosition();
    mui('#pullrefresh').pullRefresh().refresh(true);
}

function SubCondition(){
    flags =3;
    var list_map = new Array();
    var name = $("#search_input").val();
    list_map.push({conditionName:'项目类型',conditionValue:proType});
    list_map.push({conditionName:'项目阶段',conditionValue:proStage});
    list_map.push({conditionName:'所属空域',conditionValue:airspace});
    list_map.push({conditionName:'是否超高',conditionValue:ishigh});
    list_map.push({conditionName:'是否航空障碍灯',conditionValue:isLight});
    $.ajax({
           type: "POST",
           url: url_prefix + "home/queryProjectListByCondition",
           data: {
           request: JSON.stringify({
                                   "token":token,
                                   "name":name,
                                   "pageNum":pageNum,
                                   "pageSize":pageSize,
                                   "conditionValue":list_map
                                   })
           },
           dataType: "json",
           success: function(data){
           if(data.code == '200'){
           var proList = data.result.list
           if(proList.length<1){
           mui.toast('暂无数据...')
           isOver = true;
           mui('#pullrefresh').pullRefresh().endPullupToRefresh(isOver);
           }else{
           if(pageNum == 1){
           $("#div1").empty()
           }
           var str = null;
           for(var i = 0;i<proList.length;i++){
           str = '<div class="projectList" name="'+proList[i].projectId+'" proName="'+proList[i].projectName+'"><div class="project_img float_l" ><img style = "height: 95px;" src='+proList[i].projectImg+'>';
           str =str+'</div><div class="project_right float_l"><p class="project_name" value='+proList[i].projectName+'></p>';
           str = str +'<p class="project_ad" hidden="hidden" id="proId'+i+'">'+proList[i].projectId+'</p>';
           str = str +'<p style="font-size:15px;">'+proList[i].projectName+'</p>'
           str = str +'<p class="project_ad" >地址：'+proList[i].address+'</p>';
           str = str +'<div class="project_nub">';
           str = str +'<div class="project_nub_sb"><img class="float_l project_nub_img" src="img/icon_controller_nub@2x.png">'+proList[i].projectAllNum+'</div>';
           str = str +'<div class="float_l state_nub"><span class="controller_nom float_l"></span>'+proList[i].projectGoodNum+'</div>';
           str = str +'<div class="float_l state_nub"><span class="controller_bad float_l"></span>'+proList[i].projectBadNum+'</div>';
           str = str +'<div class="clear"></div></div><div class="project_speed">';
           str = str +'<div class="float_l project_speed_nub"><img class="float_l project_speed_img" src="img/icon_speed@2x.png">'+proList[i].windValue+' m/s</div>';
           str = str +'<a id="'+proList[i].projectId+'" class="list_but float_r" >设置警报</a><div class="clear"></div></div></div><div class="clear"></div></div>'
           $("#div1").append(str);
           }
           var tPage = 0;
           var ys = data.result.total%pageSize
           if(ys>0){
           tPage = data.result.total/pageSize + 1
           }else{
           tPage = data.result.total/pageSize
           }
           if(pageNum<tPage){
           if(proList.length < pageSize){
           isOver = true;
           mui('#pullrefresh').pullRefresh().endPullupToRefresh(isOver);
           }
           if(isOver == false){
           pageNum++;
           }
           }else{
           isOver = true;
           mui('#pullrefresh').pullRefresh().endPullupToRefresh(isOver);
           }
           }
           
           }else if (data.code == '300'){
           mui.toast("帐号在其他设备上登录")
           window.location.href="fastLogin.html"
           }else{
           mui.toast("连接服务器失败,请稍后重试``````");
           }
           $("#procondiv").val("true")
           $("#divselc").hide();
           $("#divlist").show();
           },
           error: function(XMLHttpRequest, textStatus, errorThrown) {
           mui.toast("连接服务器失败,请稍后重试``````");
           }
           });
}
function cancelCondition(){
    $("#divselc").hide();
    /*    pageNum = 1;
     flags = 1;
     isOver = false;
     SelectPosition()
     mui('#pullrefresh').pullRefresh().refresh(true);*/
    //            getPro();
    $("#divlist").show();
};

function setWarning(v){
    $.ajax({
           type: "POST",
           url: url_prefix + "home/getProjectWindWarning",
           dataType: 'JSON',
           data: {
           request: JSON.stringify({
                                   token: token,
                                   projectId:v
                                   })
           },
           success: function(data) {
           if(data.code =='200'){
           // mui.toast(data.message)
           if(data.result.warningValue==''||data.result.warningValue==null){
           $("#windleve").html('');
           }
           $("#windleve").html('已设风力警报值为:'+data.result.warningValue);
           }else{
           // mui.toast(data.message)
           }
           
           }
           });
    
    $("#divWall").show();
};
function cancelWarning(){
    $("#divWall").hide();
};
function subWarning(){
    var projectId = $("#proids").val();
    var WarningValue = $("#wind").val();
    if(WarningValue == ""){
        mui.toast("请输一个正整数");
        return
    }
    if(!(/^[0-9]{0,10}$/.test(WarningValue))){
        mui.toast("请输一个正整数");
    }else{
        $.ajax({
               type: "POST",
               url: url_prefix + "home/setProjectWindWarning",
               data: {
               request: JSON.stringify({
                                       "token":token,
                                       "projectId":projectId,
                                       "warningValue":WarningValue
                                       })
               },
               dataType: "json",
               success: function(data){
               if(data.code == '200'){
               mui.toast("设置成功");
               $("#divWall").hide();
               /*localStorage.setItem("companyIcon",data.result.companyIcon)*/
               /*window.location.href = '2-2项目详情下拉窗.html'*/
               }else if (data.code == '300'){
               mui.toast("帐号在其他设备上登录")
               window.location.href="fastLogin.html"
               }else{
               mui.toast("连接服务器失败,请稍后重试``````");
               }
               },
               error: function(XMLHttpRequest, textStatus, errorThrown) {
               
               mui.toast("连接服务器失败,请稍后重试``````");
               }
               });
    }
};
var flag = getUrlParam("bool")
if(flag == "true"){
    $(".myInfo").show("fast")
};
function showInfo(){
    $.ajax({
           type: "POST",
           url: url_prefix + "home/informationList",
           data: {
           request: JSON.stringify({
                                   "token":token,
                                   "pageNum":pageNum,
                                   "pageSize":pageSize
                                   })
           },
           dataType: "json",
           success: function(data){
           if(data.code == '200'){
           if(data.total==0){
           window.location.href = 'nullMsg.html'
           }else{
           window.location.href = 'message.html'
           }
           }else if (data.code == '300'){
           mui.toast("帐号在其他设备上登录")
           window.location.href="fastLogin.html"
           }else{
           mui.toast("连接服务器失败,请稍后重试``````");
           }
           },
           error: function(XMLHttpRequest, textStatus, errorThrown) {
           
           mui.toast("连接服务器失败,请稍后重试``````");
           }
           });
}
var loginData = JSON.parse(localStorage.getItem("LoginData"))
if(loginData!=null){
    $("#toux").attr("src",loginData.headImg)
    $(".my_name").html(loginData.userName)
    $(".my_ph").html(loginData.mobile)
}

function showUser(){
    $(".myInfo").css("left","-100%")
    $(".myInfo").fadeIn("fast").animate({"left":0},200);
};
function showPro(){
    $(".myInfo").animate({"left":"-100%"},200);
};
function getUrlParam(name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
    var r = window.location.search.slice(1).match(reg);
    if (r != null) return unescape(r[2]); return null;
};
function refeshPro(){
    //    $("#div1").empty();
    isOver = false
    pageNum = 1
    mui('#pullrefresh').pullRefresh().refresh(true);
    SelectPosition()
}

